package com.cbl.v.ssczs.mode.net;


import org.xutils.common.Callback;


/**
 * Created by wangfan on 2016/03/29.
 */
public abstract class HttpResponseHandler implements Callback.CommonCallback<String> {

    public abstract void onSuccess(NetMessage message);
    public abstract void onError(Throwable throwable);
    public abstract void onFinish();

    @Override
    public void onSuccess(String result) {
        onSuccess(new NetMessage(result));
    }

    @Override
    public void onError(Throwable throwable, boolean isOnCallback) {
        onError(throwable);
    }

    @Override
    public void onCancelled(CancelledException cex) {
    }

    @Override
    public void onFinished() {
        onFinish();
    }
}